package com.reebake.ideal.message.websocket.config;

import com.reebake.ideal.message.websocket.core.DefaultWebSocketMessageListener;
import com.reebake.ideal.message.websocket.core.DefaultWebsocketMessagePublisher;
import com.reebake.ideal.message.websocket.core.WebsocketMessageListener;
import com.reebake.ideal.message.websocket.core.WebsocketMessagePublisher;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class WebSocketConfig {

    @Bean
    @ConditionalOnMissingBean
    WebsocketMessagePublisher websocketMessagePublisher() {
        return new DefaultWebsocketMessagePublisher();
    }

    @Bean
    @ConditionalOnMissingBean
    WebsocketMessageListener websocketMessageListener() {
        return new DefaultWebSocketMessageListener();
    }
}
